import * as express from 'express';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // 静态目录
  app.use("/app", express.static('app_dist'))
  app.use("/pub", express.static('public'));

  // 获取参数
  let p_x = process.argv.indexOf("-p");
  let p = p_x >= 0 && Number(process.argv[p_x + 1]) || 13001

  await app.listen(p);
}
bootstrap();
